﻿using System.Web.Mvc;
using ML.IBusiness;
using ML.Entity;

namespace ML.Web.Controllers
{
    /// <summary>
    /// 商户的资金账户
    /// </summary>
    [Login]
    public class CapitalAccountController : BaseController
    {
        private readonly ICapitalAccountBusiness capitalAccountBusiness;
        public CapitalAccountController(ICapitalAccountBusiness _capitalAccountBusiness)
        {
            capitalAccountBusiness = _capitalAccountBusiness;
        }

        /// <summary>
        /// 商户的资金账户页面
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 根据查询条件查询资金账户信息
        /// </summary>
        /// <param name="capitalAccountSearch">资金账户查询条件</param>
        /// <returns></returns>
        [HttpGet]
        [AjaxOnly]
        public ActionResult List(CapitalAccountSearch capitalAccountSearch)
        {
            var data = capitalAccountBusiness.List(capitalAccountSearch);
            return JsonDateTime(data);
        }
    }
}